<template>
	<view class="my">
		<view class="userInfo">
			<view class="bg">
				<image src="@/static/image/content/1.png"></image>
			</view>
			<view class="content">
				<view class="user-setup">
					<view class="space">
						<view class="space-ico">
							<image></image>
						</view>
						<view class="title-box">
							<text>空间</text>
						</view>
					</view>
					<view class="user-setup">
						<image src="@/static/image/nav-iocs/news1.png"></image>
					</view>
				</view>
				<view></view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				getMyUrl: 'my.php',
				params: this.$store.state.login
			}
		},
		methods: {
			async api (url, params) {
				const { data: res } = await this.$myHttp({ // 获取公钥
					url: url,
					data: params
				})
				console.log(res);
			},
			getMy () {
				let that = this
				const Pro = new Promise(function (resolve, reject) {
					uni.getStorage({
						key: 'Token',
						success (z) {
							resolve(z)
						},
						fail (e) {
							resolve(e)
						}
					})
				})
				Pro.then(function (res) {
					that.api(that.getMyUrl, that.params)
				})
			}
		},
		created () {
			this.getMy()
		}
	}
</script>

<style>
	.my {
		font-size: 14px;
		line-height: 24px;
	}
	.userInfo {
		width: 100%;
		height: 45vh;
	}
	.userInfo .bg{
		position: absolute;
		top: 0;
		left: 0;
		z-index: 0;
		width: 100%;
		height: 45vh;
	}
	.userInfo image{
		width: 100%;
		height: 100%;
	}
	.userInfo .content{
		position: absolute;
		top: 0;
		left: 0;
		z-index: 1;
		width: 100%;
		height: 45vh;
	}
</style>
